var language = document.cookie.match(/language=([^;]+)/);
var locale = "zh-cn";
if (language) {
  locale = language[1].split("_")[0];
}

require.config({
  baseUrl: "js",
  paths: {
    jquery: "lib/jquery",
    bootstrap: "lib/bootstrap",
    text: "lib/requirejs/text",
    css: "lib/requirejs/css",
    i18n: "lib/requirejs/i18n"
  },
  shim: {
    bootstrap: ["jquery"]
    // "jquery-ui": [
    //   "css!/../css/jquery-ui/jquery-ui.css",
    //   "css!/../css/jquery-ui/jquery-ui.theme.css"
    // ]
  },
  urlArgs: "_=" + Date.now(),
  config: {
    text: {
      onXhr: function(xhr, url) {
        xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
      }
    },
    i18n: {
      locale: typeof locale !== "undefined" ? locale : "zh"
    }
  }
  // map: {
  //   '*': {
  //     'css': 'requirejs/css'
  //   }
  // }
});